package com.lj.back.manage.scaffold.module.sys.DTO;

import com.lj.back.manage.scaffold.common.valid.group.AddStrategy;
import com.lj.back.manage.scaffold.common.valid.group.UpdateStrategy;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * 角色DO对象
 * @author lv
 * @version 1.0.0
 */
@Data
@ApiModel("后台角色传输对象")
public class SysRoleDTO implements Serializable {

    @NotNull(message = "{role.id.notnull}",groups = UpdateStrategy.class)
    @Null(message = "{role.id.isnull}",groups = AddStrategy.class)
    @ApiModelProperty(value = "角色ID", example = "1")
    private Long id;

    @NotNull(message = "{role.id.notnull}",groups = AddStrategy.class)
    @Null(message = "{role.id.isnull}",groups = UpdateStrategy.class)
    @ApiModelProperty(value = "角色名称", example = "普通管理员")
    private String name;

    @ApiModelProperty(value = "菜单ID集合", example = "[1,2,3]")
    private Set<Long> menuIds;

    @ApiModelProperty(value = "描述信息", example = "这是一个测试角色")
    private String describe;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    private static final long serialVersionUID = 1L;
}
